package com.oocl.communicator.impl;

import java.io.EOFException;
import java.io.IOException;
import java.io.ObjectInputStream;

import com.oocl.communicator.Receiver;
import com.oocl.constant.LogLevel;
import com.oocl.pojo.Protocol;
import com.oocl.util.ConsoleLogUtil;

public class ReceiverImpl implements Receiver{

	@Override
	public Protocol receive(ObjectInputStream in) throws IOException, ClassNotFoundException {
		Protocol protocol = null;
		try {
			protocol = (Protocol) in.readObject();
		} catch (EOFException e) {
			ConsoleLogUtil.log("Server EOFException! "+e.getMessage(), LogLevel.ERROR);
		}
		return protocol;
	}
	
}
